# 1.打开浏览器
from time import sleep

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

service = Service(executable_path=r'E:\python\pythonshuju\chromedriver.exe')
driver = webdriver.Chrome(service=service)  #创建浏览器对象
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")
# 3.页面信息操作
sleep(2)
#选择'上海'
# 通过css定位，通过标签option的属性值 value 定位
driver.find_element(By.CSS_SELECTOR,"[value='sh']").click()
sleep(2)
driver.find_element(By.CSS_SELECTOR,"[value='gz']").click()

# 4.关闭/退出浏览器
driver.quit()